/*AyflEomXWyqCHfdTxzWda1e2+xM16UdiCeHmo0c2GDI=*/
/**
 * 工具类集合
 * @author  chendch
 *
 * 使用说明：
 *
 * import  Utils from '../../../public/utils';
 *
 * 深复制简单实用
 * let new_obj =   Utils.clone(obj);
 *
 * 将保存后返回的数据更新到页面中
 * 调用完方法后，allD为更新后的数据结构对象
 * Utils.filterResult(allD,data[tableid].rows);
 *
 *
 * 表格数查询启用状态值转化
 * 改方法在获取后台数据放置到页面时调用，已经获取页面数据传递给后台时调用
 * let  rows = Utils.convertGridEnablestate(rows);
 *
 * 过来表格删除的行
 * @param  rows 页面表格中行数据的数组
 * Utils.filterDelRows(tableData.rows);
 *
 *
 * 后台返回表格数处理
 * @param   props   prpos参数
 * @param   tableid 表格id
 * @param   data    后台返回数据对象
 * @param   empty   数据为空时执行回调方法
 * @param   notEmpty    数据不为空时执行回调方法
 * @param   after   处理完成后执行回到方法
 * Utils.handleTableReData({
 		data : data,
		tableid : tableid,
		props : this.props,
		empty : (data) => {

		},
		notEmpty : (data)=>{
			data[tableid].rows.forEach(function(item, index, array){
				if (item.values['doclevel'].value === '1') {
					item.values['code'].disabled = 'on';
					item.values['name'].disabled = 'on';
					item.values['mngctlmode'].disabled = 'on';
					item.values['isgrade'].disabled = 'on';
				}
			});

		},
		after : (data)=> {
			allTableData = data[tableid];
			this.updateButtonStatus();
		}
	});
 */

import {filterResult,convertGridEnablestate,convertGridEnablestateToSave,convertGridEnablestateToShow,filterDelRows,handleTableReData,filterArraybyAttr,filterArraybyPks,convertDelData,filterEmptyData} from './tableUtil';
import {filterEmtyOptionItem} from "./arrayUtil";
import BaseUtils from './base.js'
import DateUtils from './dateUtil';

import {
	checkHasChildren,
	dealTreeData,
	createTreeData,
	addVirtualRootNode,
	expandFirstNode
} from './treeUtil';
import {checkHasProps,convertEnableState, filterFormEmptyVal} from './formUtil';
import BillCodeUtil from './billCodeUtil.js';
import queryToastFunc from './queryToastFunc';
import {showFormular} from './formulaUtils'
import {
	uuid,
	beforeUnload
} from "./deviceUtil";
import {
	handelMetaFormBefore2Condition,
	getMetaItem,
	addQueryConditon,
  deleteQueryCondition
} from "./metaUtil";
import BDCreateUIDom from "./BDCreateUIDom";
import {checkPropExist} from "./objectUtil";
import deepClone from './deepClone';
import BDselect  from './bdselected.js';
import initPage  from './initPage.js';



var mergeData = function(values, areaitems){
	areaitems.forEach(item => {
		var attrcode = item.attrcode;
		var initialvalue = item.initialvalue;
		var valueobj = values[attrcode];
		if(initialvalue && initialvalue.value && (!valueobj || !valueobj.value ) ){
			values[attrcode] = initialvalue;
		}
	});
}

var Utils = {
	clone: deepClone,
  filterResult,
  convertGridEnablestate,
  filterDelRows,
  handleTableReData,
  checkHasChildren,
  checkHasProps,
	dealTreeData,
	createTreeData,
	addVirtualRootNode,
	expandFirstNode,
	filterArraybyAttr,
	filterArraybyPks,
  convertEnableState,
	filterFormEmptyVal,
	BDselect,
  convertDelData: convertDelData,
  BillCodeUtil,
  queryToastFunc:queryToastFunc,
	initPage,
  convertGridEnablestateToSave,
  convertGridEnablestateToShow,
	showFormular:showFormular,
	filterEmptyData,
	mergeData,
	uuid,
	beforeUnload,
	handelMetaFormBefore2Condition,
	getMetaItem,
	addQueryConditon,
  deleteQueryCondition,
	filterEmtyOptionItem,
	BDCreateUIDom,
	checkPropExist
};

export default Utils;
export {BaseUtils};
export {DateUtils}


/*AyflEomXWyqCHfdTxzWda1e2+xM16UdiCeHmo0c2GDI=*/
